package com.fcscs.cservice.ws.client.inroomservice;

import org.apache.log4j.Logger;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

import com.fcscs.cservice.ws.schema.inroomservice.CreateOrderRequest;
import com.fcscs.cservice.ws.schema.inroomservice.CreateOrderResponse;

public class CreateOrderClient extends WebServiceGatewaySupport {

	private static final Logger LOG = Logger.getLogger(CreateOrderClient.class);

	public CreateOrderResponse createOrder(CreateOrderRequest req) {
		CreateOrderResponse resp = (CreateOrderResponse)getWebServiceTemplate().marshalSendAndReceive(req);
		LOG.info("---------- CreateOrderResponse: " + resp.getOrderView() == null ? resp.getErrorMsg() : resp.getOrderView().getOrderId());
		return resp;
	}
}
